/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Peer.peerRequest;

import Peer.KoTorrentInt;
import java.util.ArrayList;

/**
 *
 * @author user
 */
public class piece {

    public KoTorrentInt len;
    public final byte id = 7;
    public ArrayList<Byte> block;
    public KoTorrentInt index;
    public KoTorrentInt begin;

    public piece() {
        this.block = new ArrayList<Byte>();
        len = new KoTorrentInt(9);
    }

    public piece(int idx, int begin, ArrayList<Byte> bf ) {
        this.block = bf;
        
        len = new KoTorrentInt(9 + block.size());
        this.index = new KoTorrentInt(idx);
        this.begin = new KoTorrentInt(begin);
    }

    public piece(KoTorrentInt idx, KoTorrentInt begin, ArrayList<Byte> bf ) {
        this.block = bf;

        this.len = new KoTorrentInt(9 + block.size());
        this.index = idx;
        this.begin = begin;
    }
}
